<%@page import="java.util.UUID"%>
<%@page import="java.util.Date"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="com.sinba.common.user.dto.RegisterUserDTO"%>
<%@page import="com.sinba.common.user.dto.RegisterUserQueryDTO"%>
<%@page import="com.sinba.common.user.service.IRegisterUserService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="../language.jsp" %>
<%
	if(session.getAttribute("loginName")==null){
		response.sendRedirect( "extendLink.jsp");
		return;
	}
	ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
	IRegisterUserService registerUserService = (IRegisterUserService)ac.getBean("registerUserService");
	RegisterUserQueryDTO qdto = new RegisterUserQueryDTO();
	qdto.setLoginName((String)session.getAttribute("loginName"));
	RegisterUserDTO dto = registerUserService.findRegisterUserByIdOrLoginName(qdto);
	request.setAttribute("dto",dto);
	String tuGuangDc = request.getParameter("tuGuangDc");
	if(tuGuangDc!=null){
		registerUserService.updateTuGuangDc((String)session.getAttribute("loginName"),tuGuangDc);
	}

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<title><fmt:message key="i18n.update"/><fmt:message key="title.extendLink" /></title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- Bootstrap framework -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" />
<!-- breadcrumbs-->
	<link rel="stylesheet" href="lib/jBreadcrumbs/css/BreadCrumb.css" />
<!-- main styles -->
    <link rel="stylesheet" href="css/sub_page_main_style.css" />

<!--[if lte IE 8]>
    <link rel="stylesheet" href="css/ie.css" />
    <script src="js/ie/html5.js"></script>
    <script src="js/ie/respond.min.js"></script>
<![endif]-->


<script type="text/javascript">

</script>
</head>
<body style="height:500px">
<div id="contentwrapper">
	<div class="main_content">
		<nav>
            <div id="jCrumbs" class="breadCrumb module">
                <ul>
                    <li>
                        <a href="main.jsp"><i class="icon-home"></i></a>
                    </li>
                    <li>
                        <a href="#"><fmt:message key="i18n.userCenter"/></a>
                    </li>
                    <li>
                        <a href="#"><fmt:message key="title.extendLink"/></a>
                    </li>
                </ul>
            </div>
         </nav>
           <div class="listCont">
           		<%-- <form action="extendLink.jsp" method="get" id="tuGuangDc_form">
           		报单中心:<input name="tuGuangDc" value="${dto.tuGuangDc }" id="tuGuangDc" > 
           		<input type="button" onclick="gantuGuangDc()" value="生成推广链接">
           		</form>
           		<script>
           		function gantuGuangDc(){
           			$('#tuGuangDc_form').submit();
           		}
           		</script>
           		<br><br> --%>
           		<h3 class="heading"><fmt:message key="title.extendLink" /></h3>
           		<c:set var="extendLink" value="http://vip.hmcft.com/user/rec.jsp?"></c:set>
           		
           		<br>
           		<input style="width: 90%" value="${ extendLink }key=<%=UUID.randomUUID() %>&recommendUser=${loginName}" />
           		<br>
           		<span style="font-size:14px;font-weight: bold;"><fmt:message key="i18n.extendLinkTip" /></span>
           </div>
           
    </div>
</div>

<script type="text/javascript" src="../scripts/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../scripts/user/common.js"></script>
</body>
</html>